using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._3DAnalystTools._Statistics
{
    /// <summary>
    /// <para>LAS Height Metrics</para>
    /// <para>Calculates statistics about the distribution of elevation measurements of vegetation points captured in LAS data.</para>
    /// <para>计算有关 LAS 数据中捕获的植被点的高程测量值分布的统计数据。</para>
    /// </summary>    
    [DisplayName("LAS Height Metrics")]
    public class LasHeightMetrics : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public LasHeightMetrics()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_las_dataset">
        /// <para>Input LAS Dataset</para>
        /// <para>The LAS dataset to process.</para>
        /// <para>要处理的 LAS 数据集。</para>
        /// </param>
        /// <param name="_out_location">
        /// <para>Output Location</para>
        /// <para>The folder or geodatabase where the output raster datasets will reside. When the output location is a folder, the resulting raster datasets will be in the TIFF format.</para>
        /// <para>输出栅格数据集将驻留的文件夹或地理数据库。当输出位置为文件夹时，生成的栅格数据集将采用 TIFF 格式。</para>
        /// </param>
        public LasHeightMetrics(object _in_las_dataset, object _out_location)
        {
            this._in_las_dataset = _in_las_dataset;
            this._out_location = _out_location;
        }
        public override string ToolboxName => "3D Analyst Tools";

        public override string ToolName => "LAS Height Metrics";

        public override string CallName => "3d.LasHeightMetrics";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "outputCoordinateSystem", "workspace"];

        public override object[] ParameterInfo => [_in_las_dataset, _out_location, _base_name, _statistics, _height_percentiles, _min_height, _min_points, _cell_size, _derived_out_location, _output_rasters, _raster_format.GetGPValue()];

        /// <summary>
        /// <para>Input LAS Dataset</para>
        /// <para>The LAS dataset to process.</para>
        /// <para>要处理的 LAS 数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input LAS Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_las_dataset { get; set; }


        /// <summary>
        /// <para>Output Location</para>
        /// <para>The folder or geodatabase where the output raster datasets will reside. When the output location is a folder, the resulting raster datasets will be in the TIFF format.</para>
        /// <para>输出栅格数据集将驻留的文件夹或地理数据库。当输出位置为文件夹时，生成的栅格数据集将采用 TIFF 格式。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Location")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_location { get; set; }


        /// <summary>
        /// <para>Output Base Name</para>
        /// <para>The base name for the output raster datasets.</para>
        /// <para>输出栅格数据集的基本名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Base Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _base_name { get; set; } = null;


        /// <summary>
        /// <para>Statistics Options</para>
        /// <para><xdoc>
        ///   <para>Specifies the statistics calculated for the unclassified and vegetation points above the ground that are within the area of each cell in the output raster.</para>
        ///   <bulletList>
        ///     <bullet_item>Mean—The average height of the LAS points.</bullet_item><para/>
        ///     <bullet_item>Kurtosis—The sharpness of the change in the height of the LAS points.</bullet_item><para/>
        ///     <bullet_item>Skewness—The direction of deviation from the nominal height of the LAS points, which indicates the level and direction of asymmetry.</bullet_item><para/>
        ///     <bullet_item>Standard Deviation—The variation of the height of the points.</bullet_item><para/>
        ///     <bullet_item>Median Absolute Deviation—The median value of the deviation from the median height.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定为输出栅格中每个像元区域内的地上未分类点和地面上的植被点计算的统计数据。</para>
        ///   <bulletList>
        ///     <bullet_item>平均值 - LAS 点的平均高度。</bullet_item><para/>
        ///     <bullet_item>峰度 - LAS 点高度变化的锐度。</bullet_item><para/>
        ///     <bullet_item>偏斜 - 偏离 LAS 点标称高度的方向，表示不对称的水平和方向。</bullet_item><para/>
        ///     <bullet_item>标准差 （Standard Deviation） - 点高度的变化。</bullet_item><para/>
        ///     <bullet_item>中位数绝对偏差 - 与中位高度偏差的中值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Statistics Options")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _statistics { get; set; } = null;


        /// <summary>
        /// <para>Height Percentiles</para>
        /// <para>The height at which the specified percentage of points in the cell fall below. For example, a value of 95 means the resulting cell values indicate the height at which 95 percent of points above the ground occur.</para>
        /// <para>单元格中指定百分比的点低于该点的高度。例如，值 95 表示生成的像元值指示离地面 95% 的点出现的高度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Height Percentiles")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _height_percentiles { get; set; } = null;


        /// <summary>
        /// <para>Minimum Height</para>
        /// <para>The minimum height above ground for points that will be evaluated.</para>
        /// <para>将要评估的点的离地最小高度。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Height")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _min_height { get; set; } = "2 Meters";


        /// <summary>
        /// <para>Minimum Number of Points</para>
        /// <para>The minimum number of points that must be present in a given cell to calculate height metrics. Cells with fewer points than the specified minimum will have no data in the output.</para>
        /// <para>给定单元格中必须存在的最小点数，以计算高度指标。点数少于指定最小值的单元格在输出中将没有数据。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Minimum Number of Points")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long _min_points { get; set; } = 4;


        /// <summary>
        /// <para>Cell Size</para>
        /// <para>The cell size of the output raster datasets.</para>
        /// <para>输出栅格数据集的像元大小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Cell Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _cell_size { get; set; } = "20 Meters";


        /// <summary>
        /// <para>Output Location</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Location")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _derived_out_location { get; set; }


        /// <summary>
        /// <para>Output Raster</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Raster")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _output_rasters { get; set; }


        /// <summary>
        /// <para>Raster Format</para>
        /// <para><xdoc>
        ///   <para>Specifies the raster format that will be created when the output location is a folder.</para>
        ///   <bulletList>
        ///     <bullet_item>GeoTiff—Output will be created in the GeoTIFF format. This is the default.</bullet_item><para/>
        ///     <bullet_item>Erdas Imagine (IMG)—Output will be created in the ERDAS IMAGINE format.</bullet_item><para/>
        ///     <bullet_item>Esri Grid—Output will be created in the Esri Grid format.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出位置为文件夹时将创建的栅格格式。</para>
        ///   <bulletList>
        ///     <bullet_item>GeoTiff—输出将以 GeoTIFF 格式创建。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>Erdas Imagine （IMG）—输出将以 ERDAS IMAGINE 格式创建。</bullet_item><para/>
        ///     <bullet_item>Esri Grid - 输出将以 Esri Grid 格式创建。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Raster Format")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _raster_format_value _raster_format { get; set; } = _raster_format_value._TIFF;

        public enum _raster_format_value
        {
            /// <summary>
            /// <para>GeoTiff</para>
            /// <para>GeoTiff—Output will be created in the GeoTIFF format. This is the default.</para>
            /// <para>GeoTiff—输出将以 GeoTIFF 格式创建。这是默认设置。</para>
            /// </summary>
            [Description("GeoTiff")]
            [GPEnumValue("TIFF")]
            _TIFF,

            /// <summary>
            /// <para>Erdas Imagine (IMG)</para>
            /// <para>Erdas Imagine (IMG)—Output will be created in the ERDAS IMAGINE format.</para>
            /// <para>Erdas Imagine （IMG）—输出将以 ERDAS IMAGINE 格式创建。</para>
            /// </summary>
            [Description("Erdas Imagine (IMG)")]
            [GPEnumValue("IMG")]
            _IMG,

            /// <summary>
            /// <para>Esri Grid</para>
            /// <para>Esri Grid—Output will be created in the Esri Grid format.</para>
            /// <para>Esri Grid - 输出将以 Esri Grid 格式创建。</para>
            /// </summary>
            [Description("Esri Grid")]
            [GPEnumValue("ESRI_GRID")]
            _ESRI_GRID,

        }

        public LasHeightMetrics SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object workspace = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, workspace: workspace);
            return this;
        }

    }

}